package com.young.springdemo.service.statePattern;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

//测试状态模式
//@Component
public class testAccount {

    //    @PostConstruct
    public void testAccount() {
        Account account = new Account("张无忌", 100);
        account.deposit(1000);
        account.withdraw(1000);
        account.withdraw(1000);
        account.withdraw(1000);

        account.withdraw(1000);
        account.withdraw(-500);
        account.deposit(5000);
        account.withdraw(1000);
    }

}
